<template>
    <div class="Login">
        <van-row>
            <van-col span="6">
                <img :src="avatar" alt="">
                <span>{{userInfo.nickname}}</span>
            </van-col>
        </van-row>
        <van-grid :border="true" :column-num="3">
            <van-grid-item icon="todo-list-o" text="我的订单" dot />
            <van-grid-item>
            <van-grid-item icon="gift-o" text="优惠卷" dot />
            </van-grid-item>
            <van-grid-item icon="coupon-o" text="礼品卡" dot />
            </van-grid-item>
            <van-grid-item icon="fire-o" text="我的收藏" dot />
            <van-grid-item>
            <van-grid-item icon="like-o" text="我的足迹" dot />
            </van-grid-item>
            <van-grid-item icon="
            point-gift-o" text="会员福利" dot />
            </van-grid-item>
            <van-grid-item icon="shop-o
            " text="地址管理" dot />
            <van-grid-item>
            <van-grid-item icon="shield-o" text="账号安全" dot />
            </van-grid-item>
            <van-grid-item icon="more-o" text="联系客服" dot />
            </van-grid-item>
            <van-grid-item icon="smile-o" text="帮助中心" dot />
            <van-grid-item>
            <van-grid-item icon="phone-circle-o" text="意见反馈" dot />
            </van-grid-item>
            <van-grid-item>
                <van-button @click="logout()" type="default">退出登录</van-button>
            </van-grid-item>
           
        </van-grid>
      
    </div>
</template>

<script>
    export default {
        name: 'YxMylogin',

        data() {
            return {
                    // 用户信息
                    userInfo:[],
                    // 头像
                    avatar:require("../assets/avtiv.png")
            };
        },

        mounted() {
        this.userInfo=JSON.parse(localStorage.getItem('userInfo'));
        this.avatar = this.userInfo.avatar
      
        },

        methods: {
         logout(){
            localStorage.removeItem("token");
            localStorage.removeItem("userInfo");
            this.$router.push({path:'/Home'})
         }
        },
    };
</script>

<style lang="scss" scoped>
    .Login{
        text-align: center;
        .van-button{
      
         font-size: .28rem;
    }
    }
  
    .van-col{
       margin: .1rem  40%;
        img{
            border-radius: 1rem;
        }
    }

.van-grid{
    margin-top: .1rem;
}
</style>
